package cn.bdqn.dao.questionBank;

import cn.bdqn.pojo.questionBank.Subject;
import cn.bdqn.pojo.questionBank.TestPaper;
import cn.bdqn.vo.questionBank.test_paper.TestPaperVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

@Mapper
public interface TestPaperDao extends BaseMapper<TestPaper> {

    /**
     * 分页查询试卷信息
     * @param status
     * @param testPaperTypeId
     * @param accountTypeId
     * @return
     */
    List<TestPaperVo> selectPageTestPaper(@Param("status") Integer status, @Param("testPaperTypeId") Integer testPaperTypeId,@Param("accountTypeId") Integer accountTypeId);

    /**
     * 查询试卷的题目
     * @param testPaperId
     * @return
     */
    List<Subject> selectSubjectByTestPaperId(Integer testPaperId);

    /**
     * 添加试卷中间表
     * @param testPaperId 试卷id
     * @param subjectId 题目id
     * @return
     */
    Integer insertTestPaperSubject(@Param("testPaperId") Integer testPaperId,@Param("subjectId") List<Integer> subjectId);

    List<Integer> selectSubjectId(Integer testPaperId);

    /**
     * 查询试卷题目发布未发布数量
     * @return
     */
    List<Integer> selectCountNumber();

    /**
     * 批量删除
     * @param integers
     * @return
     */
    Integer deleteTestPaperList(List<Integer> integers);
}
